package router

import (
	backendVip "github.com/beherochuling/beesoft_api/app/api/backend/vip"
	"github.com/beherochuling/beesoft_api/app/api/vip"
	"github.com/beherochuling/beesoft_api/app/service"
	"github.com/gogf/gf/v2/net/ghttp"
)

func Vip(group *ghttp.RouterGroup) {
	group.Group("/accounts", func(group *ghttp.RouterGroup) { // 会员
		group.POST("/", vip.Account.Show)
	})
	group.Group("/groups", func(group *ghttp.RouterGroup) { // 团队
		group.GET("/", vip.Group.Show)
		group.POST("/", vip.Group.Store)
		group.PUT("/", vip.Group.Update)
		group.DELETE("/", vip.Group.Destroy)

		group.Group("/groups", func(group *ghttp.RouterGroup) { // 成员
			group.GET("/", vip.Group.ShowUsers)
			group.POST("/", vip.Group.AddUsers)
			group.PUT("/", vip.Group.UpdateUsers)
			group.DELETE("/", vip.Group.RemoveUsers)
		})
	})
	group.Group("/license", func(group *ghttp.RouterGroup) { // 激活码
		group.POST("/codes", vip.Code.Activate)
	})
	group.Group("/activities", func(group *ghttp.RouterGroup) { // 活动
		group.GET("/", vip.Activity.Show)
		group.POST("/", vip.Activity.Attend)
	})
	group.Group("/offline", func(group *ghttp.RouterGroup) { // 下线
		group.GET("/", vip.Offline.Check)
	})
	group.Group("/sdk", func(group *ghttp.RouterGroup) { // SDK
		group.Group("/codes", func(group *ghttp.RouterGroup) { // 激活码
			group.POST("/", vip.Sdk.Activate)
		})
	})
}
func VipBackend(group *ghttp.RouterGroup) {
	service.Route.Group(group).
		CURD("/vips", backendVip.Vip).
		CURD("/logs", backendVip.Log).
		CURD("/activities", backendVip.Activity).
		CURD("/activity-logs", backendVip.ActivityLog).
		CURD("/constants", backendVip.Constant)
}
